<template>
  <div class="aside-container">
    <el-menu
        default-active="2"
        class="el-menu-vertical-demo menu"
        @open="handleOpen"
        @close="handleClose"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b">
      <div class="title">个人中心</div>

      <router-link to="/center/farmerMain">
        <el-menu-item index="1">
          <i class="el-icon-location"></i>
          <span slot="title">首页</span>
        </el-menu-item>
      </router-link>
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-user"></i>
          <span>个人信息管理</span>
        </template>
        <router-link to="/center/farmerInfo">
          <el-menu-item index="2-1">编辑个人信息</el-menu-item>
        </router-link>
      </el-submenu>
      <el-submenu index="3">
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>系统功能</span>
        </template>
<!--        <el-menu-item index="3-1">农作物收藏</el-menu-item>-->
        <el-menu-item index="3-2" @click="$router.push('/center/question')">咨询专家/查看回复</el-menu-item>
      </el-submenu>
<!--      <el-submenu index="4">-->
<!--        <template slot="title">-->
<!--          <i class="el-icon-shopping-cart-2"></i>-->
<!--          <span>购物车管理</span>-->
<!--        </template>-->
<!--        <el-menu-item index="4-1">我的订单</el-menu-item>-->
<!--        <el-menu-item index="4-2">我的收藏</el-menu-item>-->
<!--      </el-submenu>-->
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "FarmerAside",
  methods: {
    handleOpen(key, keyPath) {
      // console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      // console.log(key, keyPath);
    },
  }
}
</script>

<style scoped>
  .aside-container{
    float: left;
    position: absolute;
    z-index: 2;
  }

  .menu{
    width: 300px;
    height: calc(100vh - 100px);
  }

  .title{
    position: relative;
    color: #e9e9e9;
    font-size: 25px;
    text-align: center;
    margin: 20px 0 5px;
  }
</style>